//
//  GYDateSelectView.m
//  LockManagement
//
//  Created by apple on 2018/7/27.
//  Copyright © 2018年 yunjiazhineng. All rights reserved.
//

#import "GYDateSelectView.h"
#import "GYDateTools.h"

static NSString *formatterString = @"yyyy-MM-dd";

@interface GYDateSelectView()
@property (weak, nonatomic) IBOutlet UIButton *deforeBtn;

@property (weak, nonatomic) IBOutlet UILabel *dateLable;
@property (weak, nonatomic) IBOutlet UIButton *nextBtn;

@end

@implementation GYDateSelectView

- (void)awakeFromNib {
    [super awakeFromNib];
    
    //1.显示当前日期
    self.dateLable.text = [GYDateTools returnCurrentDateToString:formatterString];
}

- (IBAction)onClcik:(UIButton *)sender {
    //1.切换日期
    self.dateLable.text = [GYDateTools returnBeforOrNextDayToDate:self.dateLable.text WithDateFormat:formatterString dateDays:sender.tag == 1 ? -1 : 1];
    self.changedTimeUpdateLogCallBack(self.dateLable.text);
}

@end
